<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <!--  使用这个页面来构造ajax请求  HTML文件放在webapp里 INF是放依赖的 -->
    <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
    <script>
        $.ajax({
            type: 'post',
            //相对路径
            url: 'method',  
            //绝对路径
            // url: '/hello_servlet/method',
            success: function(body, status){
                console.log(body);
                console.log("成功,");
            }
        });
    </script>
</body>
</html>